#pragma once

#include <MyFC/CustomWindow.h>
#include "PEditor.h"
#include "Property.h"

namespace My {

class PropertyDlg : public My::CustomWindow<CDialog>
{
	typedef My::CustomWindow<CDialog> Base;
public:
	PropertyDlg(String caption, CSize s = CSize(0, 0), CWnd * pParent = NULL);   
	virtual ~PropertyDlg();
public:
	bool Open(EditableObject * pObject);
protected:
	virtual BOOL OnInitDialog();
	virtual void DoDataExchange(CDataExchange* pDX);
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
	afx_msg LRESULT OnKickIdle(WPARAM, LPARAM);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
public:
	virtual bool CanGetFocus() const;
	virtual void LayoutControls();
	virtual void HandlePaint(CDC * pDC, const CRect &);
public:
	EditableObject *	m_pObject;
	String				m_Caption;
	CSize				m_Size;
	CButton				m_Ok;
	CButton				m_Cancel;
	My::PEditor			m_Editor;
	CFont				m_Font;
};

} // My

